#ifndef SAVED_RULES_HPP
#define SAVED_RULES_HPP

#ifdef _MSC_VER
#pragma once
#endif

#include "jam.hpp"
#include "rules.hpp"
#include "jam_ast.hpp"

class saved_rule : public jam_rule
{
	setcomp_node_const_ptr node_;
	size_t total_args_;
public:
	saved_rule(jam_context *ctx, jam_module *module,
		setcomp_node_const_ptr node, const list_of_lists &args);

	virtual const jam_string& get_name() const {return node_->rule_name_;}
	virtual jam_string get_file() const {return node_->file_;}
	virtual int get_line() const {return node_->line_;}

private:
	virtual void do_invoke(jam_frame *frame,jam_list *res);

	void argument_error(const char* message, const list_of_lists &args);
};

#endif //SAVED_RULES_HPP
